package com.hailian.fintech.hlbackingserver.web;


import com.hailian.fintech.hlbackingserver.entity.Bank;
import com.hailian.fintech.hlbackingserver.entity.Partment;
import com.hailian.fintech.hlbackingserver.service.IBankService;
import com.hailian.fintech.hlbackingserver.service.IPartmentService;
import com.hailian.fintech.hlcomm_interfaceserver.result.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wk
 * @since 2020-05-30
 */
@RestController
@RequestMapping("/partment")
public class PartmentController {
    @Autowired
    private IPartmentService iPartmentService;

    /**
     * 通过id得到公司信息
     * @param id
     * @return
     */
    @RequestMapping("getByid")
    public Object getByid(Integer id){
        Partment byId = iPartmentService.getByIdOwner(id);
        return new ResultInfo().success(byId);
    }

    /**
     * 修改地址---公司
     * @param bank
     * @return
     */
    @RequestMapping("updateAddr")
    public Object updateAddr(@RequestBody Partment bank){
        boolean flag = iPartmentService.saveOrUpdate(bank);
        return new ResultInfo().success(flag);
    }

}

